{layout name="../common/master"/}
<div id="right">
       <h4 style="border-bottom: 1px solid #ccc;padding-bottom: 3px">还款列表 <span style="font-size: 14px">总计还款记录数：{$totalCount}</span></h4>
    <form action="" method="get" role="form">
        <div class="form-group">

            <label for="">用户电话：</label>
            <input name="userPhone" {if condition="isset($_GET['userPhone'])"} value="{$_GET['userPhone']}" {/if} type="text"/>

            <label for="">还款状态：</label>
            <select name="repay_status" >
                <option value="11" selected>全部</option>
                <option {if condition="isset($_GET['repay_status']) AND ($_GET['repay_status'] eq 1)"} selected {/if} value="1">成功</option>
                <option {if condition="isset($_GET['repay_status']) AND ($_GET['repay_status'] eq 0)"} selected {/if} value="0">失败</option>
            </select>

            <label for="">提交状态：</label>
            <select name="commit_status" >
                <option value="11" selected>全部</option>
                <option {if condition="isset($_GET['commit_status']) AND ($_GET['commit_status'] eq 1)"} selected {/if} value="1">成功</option>
                <option {if condition="isset($_GET['commit_status']) AND ($_GET['commit_status'] eq 0)"} selected {/if} value="0">失败</option>
            </select>
            <br>
            <label for="">还款金额：</label>
            <input name="upAmount" {if condition="isset($_GET['upAmount'])"} value="{$_GET['upAmount']}" {/if} type="text"/>
            ~
            <input name="downAmount" {if condition="isset($_GET['downAmount'])"} value="{$_GET['downAmount']}" {/if} type="text" />

            <label for="">还款时间：</label>
            <input name="upTime" {if condition="isset($_GET['upTime'])"} value="{$_GET['upTime']}" {/if} type="text" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"/>
            ~
            <input name="downTime" {if condition="isset($_GET['downTime'])"} value="{$_GET['downTime']}" {/if} type="text" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"/>

        </div>
        <button type="submit" class="btn btn-primary">查询</button>
    </form>
    <div>
        <button id="extend" type="submit" class="btn btn-info">导出到EXCEL</button> <span>总计金额：{$totalMoney/100}</span>
    </div>
    <table class="table-bordered table  table-hover" style="margin-top: 20px;">
        <thead>
        <tr>
            <th>ID</th>
            <th>用户ID</th>
            <th>用户电话</th>
            <th>借款ID</th>
            <th>产品ID</th>
            <th>还款金额</th>
            <th>还款时间</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        {foreach name="data" item="vo" key="k"}
            <tr>
                <th>{$vo['id']}</th>
                <th>{$vo['user_id']}</th>
                <th>{$vo['user_phone']}</th>
                <th>{$vo['user_loan_id']}</th>
                <th>{$vo['product_id']}</th>
                <th>{:number_format($vo['repay_money']/100,2)}</th>
                <th>{:gmtToIndiaTimeByMysql($vo['update_time'])}</th>
                <th>
                    <div class="btn-group">
                        <a style="margin-left: 5px" href="{:URL('home/Userrepay/repayInfo',['uid'=>$vo['id']])}" class="btn btn-primary btn-sm">查看详情</a>
                    </div>
                </th>
            </tr>
        {/foreach}
        </tbody>
    </table>
    {$page}

</div>
<script>
    $("#extend").click(function () {
        var url="{:URL('home/Userrepay/userrepayList',$_GET)}";
        url=url+"&extend=1";
        location.href=url;
    })
</script>
<script type="text/javascript" src="__PUBLIC__/home/tuo/DatePicker/WdatePicker.js"></script>
